function [CovBlocksSamples] = GetCovBlocksSamples(noise, CovBlocks, Samples),
NumOfBlocks=length(CovBlocks);
if (length(noise)==1)
    noise = noise*ones(1,NumOfBlocks);
end
if (length(Samples)==1)
    Samples = Samples*ones(1,NumOfBlocks);
end

% We add for each block i symmetric Gaussian noise with variance i. 
CovBlocksSamples = cell(NumOfBlocks,1);
for i=1:NumOfBlocks
    CovBlocksSamples{i,1} = cell(1,Samples(1,i));
end

for k=1:NumOfBlocks
    for j=1:Samples(1,k)
        m = size(CovBlocks{k},1);
        A = 2*rand(m)-1;
        % Generate random positive semidefinite matrix
        [U,ignore] = eig((A+A')/2);
        S = U*diag(abs(rand(m,1)))*U';

        % Take into account level of noise
        s = noise(k)*rand(1,m);
        S = S.*(sqrt(s)'*sqrt(s));

        % Generate Gaussian noise with random covariance
        x = (S^(1/2)*randn(m,1000))';
        n = cov(x);
        CovBlocksSamples{k}{j} = n + CovBlocks{k};
    end
end